<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增实验请求')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-request-add">
        <h4 class="form-header h4">基本信息</h4>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">名称：</label>
            <div class="col-sm-8">
                <input name="reqName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">描述：</label>
            <div class="col-sm-8">
                <input name="reqDes" class="form-control" type="text">
            </div>
        </div>
        <h4 class="form-header h4">项目选择</h4>
        <div class="form-group">
            <label class="col-sm-3 control-label">项目：</label>
            <div class="col-sm-8">
                <select name="proId" class="form-control selectpicker" data-none-selected-text="请选择项目">
                    <option th:each="project:${projects}" th:data-subtext="${project.proDes}"  th:value="${project.proId}" th:text="${project.proName}"></option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-select-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/request2";
    $("#form-request-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $('#form-request-add').serializeArray();
            $.operate.save(prefix + "/add", data);
        }
    }

</script>
</body>
</html>